<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>basictextformatter.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
  </script>

  <script src="static/js/doc.js">
  </script>

  <meta charset="utf8">
</head>

<body onload="prettyPrint()">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
       <span class="fn">basictextformatter.js</span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    Functions to style text.
  </div>
  

        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="closure_goog_editor_plugins_basictextformatter.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
          </ol>
        </div>
</div>

<h2 class="g-first">File Location</h2>
  <div class="g-section g-tpl-20-80">
    <div class="g-unit g-first">
      <div class="g-c-cell code-label">editor/plugins/basictextformatter.js</div>
    </div>
  </div>
<hr/>


  <h2>Classes</h2>
 <div class="fn-constructor">
        <a href="class_goog_editor_plugins_BasicTextFormatter.html">
          goog.editor.plugins.BasicTextFormatter</a><br/>
        <div class="class-details">Functions to style text (e.g. underline, make bold, etc.)</div>
 </div>
      
<br/>

  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>


  <h2>Global Functions</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.editor.plugins.BasicTextFormatter.BR_REGEXP_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.editor.plugins.BasicTextFormatter.</span><span class="entryName">BR_REGEXP_<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Regular expression to match BRs in HTML. Saves the BRs&#39; attributes in $1 for
use with replace(). In non-IE browsers, does not match BRs adjacent to an
opening or closing DIV or P tag, since nonrendered BR elements can occur at
the end of block level containers in those browsers&#39; editors.
     </div>

   
  </td>


  <td class="view-code">
     <a href="closure_goog_editor_plugins_basictextformatter.js.source.html#line499">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.editor.plugins.BasicTextFormatter.convertContainerToTextAlign_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.editor.plugins.BasicTextFormatter.</span><span class="entryName">convertContainerToTextAlign_<span class="args">(<span class="arg">node</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Converts the block element containing the given node to use CSS text-align
instead of the align property.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">node</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/DOM/Node">Node</a></span></div>
        <div class="entryOverview">The node to convert the container of.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_editor_plugins_basictextformatter.js.source.html#line665">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.editor.plugins.BasicTextFormatter.convertParagraphToDiv_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.editor.plugins.BasicTextFormatter.</span><span class="entryName">convertParagraphToDiv_<span class="args">(<span class="arg">paragraph</span>,&nbsp;<span class="arg">opt_convertBrs</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Convert the given paragraph to being a div. This clobbers the
passed-in node!
This is only intended to be used in IE and Opera.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">paragraph</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/DOM/Node">Node</a></span></div>
        <div class="entryOverview">Paragragh to convert to a div.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_convertBrs</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>
        <div class="entryOverview">If true, also convert BRs to divs.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_editor_plugins_basictextformatter.js.source.html#line587">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.editor.plugins.BasicTextFormatter.convertToRealExecCommand_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.editor.plugins.BasicTextFormatter.</span><span class="entryName">convertToRealExecCommand_<span class="args">(<span class="arg">command</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       If this is a goog.editor.plugins.BasicTextFormatter.COMMAND,
convert it to something that we can pass into execCommand,
queryCommandState, etc.

TODO: Consider doing away with the + and converter completely.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">command</span>
        : <div class="fullType"><span class="type">goog.editor.plugins.BasicTextFormatter.COMMAND</span><span>&nbsp;|&nbsp;</span><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">A command key.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            The equivalent execCommand command.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_editor_plugins_basictextformatter.js.source.html#line620">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.editor.plugins.BasicTextFormatter.getNodeJustification_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.editor.plugins.BasicTextFormatter.</span><span class="entryName">getNodeJustification_<span class="args">(<span class="arg">element</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Determines the justification for a given block-level element.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">element</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/DOM/Element">Element</a></span></div>
        <div class="entryOverview">The node to get justification for.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            The justification for a given block-level node.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_editor_plugins_basictextformatter.js.source.html#line1458">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>



  <h2>Global Properties</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.editor.plugins.BasicTextFormatter.SUPPORTED_COMMANDS_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.editor.plugins.BasicTextFormatter.</span><span class="entryName">SUPPORTED_COMMANDS_</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span></div>
     </div>


     <div class="entryOverview">
       Inverse map of execCommand strings to
{@link goog.editor.plugins.BasicTextFormatter.COMMAND} constants. Used to
determine whether a string corresponds to a command this plugin
handles in O(1) time.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_editor_plugins_basictextformatter.js.source.html#line105">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.editor.plugins.BasicTextFormatter.SUPPORTED_JUSTIFICATIONS_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.editor.plugins.BasicTextFormatter.</span><span class="entryName">SUPPORTED_JUSTIFICATIONS_</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span></div>
     </div>


     <div class="entryOverview">
       Hash of suppoted justifications.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_editor_plugins_basictextformatter.js.source.html#line1383">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>



      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Directory plugins</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">File Reference</h2>
            <div id="sideFileIndex" rootPath="closure/goog" current="editor/plugins/basictextformatter.js"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
